package com.ruoyi.web.controller.admin;


/**
 * xsSSSS
 */

import cn.hutool.core.thread.ThreadUtil;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.XlslUtil;
import com.ruoyi.common.utils.uuid.OrderNumberGenerator;
import com.ruoyi.system.domain.xs.XsOrder;
import com.ruoyi.system.service.IXsOrderService;
import com.ruoyi.system.service.IXsStoreService;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ooxml.POIXMLDocumentPart;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.*;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;

@RestController
@RequestMapping("/system/XsSController")
public class XsSController {



    @Autowired
    private IXsOrderService xsOrderService;



    /**
     * 批量导入数据
     *
     * @param file
     * @return
     */
    @Log(title = "批量导入数据", businessType = BusinessType.IMPORT)
    @PostMapping("/batchImportClue")
    public AjaxResult batchImportClue(List<MultipartFile> file)  {
       return xsOrderService.batchImportClue(file);
    }

    /**
     * 批量修改补单
     * @param file
     * @return
     */
    @Log(title = "批量修改补单", businessType = BusinessType.IMPORT)
    @PostMapping("/replenishment")
    public AjaxResult replenishment(List<MultipartFile> file)  {
       return xsOrderService.replenishment(file);
    }


    /**
     * 批量修改结算
     * @param orderId
     * @return
     */

    @Log(title = "批量修改结算", businessType = BusinessType.IMPORT)
    @PutMapping("/expenseAccount")
    public AjaxResult expenseAccount(@RequestBody List<String> orderId)  {
        return xsOrderService.expenseAccount(orderId);
    }
}
